package com.game;

import java.util.Vector;

public class GameData {

	private static GameData ref;
	
	private Vector<Planet> m_Planets;
	private int m_CurID;
	
	private GameData()
	{
	  // no code req'd
		m_Planets = new Vector<Planet>();
		m_CurID = 0; 
	}

	public static GameData getGameData()
	{
	  if (ref == null)  ref = new GameData();		
	  return ref;
	}
	
	private void AddPlanet(Planet planet)
	{
		planet.setID(m_CurID);
		m_Planets.add(planet);
		m_CurID++;
	}
	
	public void LoadData()
	{
		// HACK: This must be replace with a real load method
		Planet auxPlanet = new Planet(R.drawable.scene4_planet0_bg);
		AddPlanet(auxPlanet);
		
		Screen auxScreen = new Screen();
		auxScreen.Unlock();
		
		auxPlanet.AddScreen(auxScreen);
		
		for(int i = 0; i < 4; i++)
		{
			auxPlanet.AddScreen(new Screen());
		}
		
	}
	
	
	public int PlanetBGName(int planet)
	{
		return m_Planets.elementAt(planet).getBgRef();
	}
	
	public Vector<Screen> PlanetScreens(int planet)
	{
		return m_Planets.elementAt(planet).GetScreens();
	}
	
}
